<?php

/**
 * EmpresaEgresos filter form base class.
 *
 * @package    cronos-doctrine
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseEmpresaEgresosFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'empresa_id'       => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Empresa'), 'add_empty' => true)),
      'numero_factura'   => new sfWidgetFormFilterInput(),
      'fecha'            => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'concepto_cf_id'   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('ConceptoCf'), 'add_empty' => true)),
      'division_id'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Division'), 'add_empty' => true)),
      'nomina_id'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Nomina'), 'add_empty' => true)),
      'operador_id'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Operador'), 'add_empty' => true)),
      'camioneta_id'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Camioneta'), 'add_empty' => true)),
      'descripcion'      => new sfWidgetFormFilterInput(),
      'producto_id'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Producto'), 'add_empty' => true)),
      'categoria_id'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Categoria'), 'add_empty' => true)),
      'entidad_id'       => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Entidad'), 'add_empty' => true)),
      'is_impuesto'      => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'is_factura'       => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'cantidad'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'presentacion'     => new sfWidgetFormFilterInput(),
      'precio'           => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'monto_confirmado' => new sfWidgetFormFilterInput(),
      'is_sobre'         => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'is_sobre_op'      => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'pago_id'          => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Pago'), 'add_empty' => true)),
      'created_at'       => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'updated_at'       => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
    ));

    $this->setValidators(array(
      'empresa_id'       => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Empresa'), 'column' => 'id')),
      'numero_factura'   => new sfValidatorPass(array('required' => false)),
      'fecha'            => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'concepto_cf_id'   => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('ConceptoCf'), 'column' => 'id')),
      'division_id'      => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Division'), 'column' => 'id')),
      'nomina_id'        => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Nomina'), 'column' => 'id')),
      'operador_id'      => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Operador'), 'column' => 'id')),
      'camioneta_id'     => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Camioneta'), 'column' => 'id')),
      'descripcion'      => new sfValidatorPass(array('required' => false)),
      'producto_id'      => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Producto'), 'column' => 'id')),
      'categoria_id'     => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Categoria'), 'column' => 'id')),
      'entidad_id'       => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Entidad'), 'column' => 'id')),
      'is_impuesto'      => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'is_factura'       => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'cantidad'         => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'presentacion'     => new sfValidatorPass(array('required' => false)),
      'precio'           => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'monto_confirmado' => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'is_sobre'         => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'is_sobre_op'      => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'pago_id'          => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Pago'), 'column' => 'id')),
      'created_at'       => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'updated_at'       => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
    ));

    $this->widgetSchema->setNameFormat('empresa_egresos_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'EmpresaEgresos';
  }

  public function getFields()
  {
    return array(
      'id'               => 'Number',
      'empresa_id'       => 'ForeignKey',
      'numero_factura'   => 'Text',
      'fecha'            => 'Date',
      'concepto_cf_id'   => 'ForeignKey',
      'division_id'      => 'ForeignKey',
      'nomina_id'        => 'ForeignKey',
      'operador_id'      => 'ForeignKey',
      'camioneta_id'     => 'ForeignKey',
      'descripcion'      => 'Text',
      'producto_id'      => 'ForeignKey',
      'categoria_id'     => 'ForeignKey',
      'entidad_id'       => 'ForeignKey',
      'is_impuesto'      => 'Boolean',
      'is_factura'       => 'Boolean',
      'cantidad'         => 'Number',
      'presentacion'     => 'Text',
      'precio'           => 'Number',
      'monto_confirmado' => 'Number',
      'is_sobre'         => 'Boolean',
      'is_sobre_op'      => 'Boolean',
      'pago_id'          => 'ForeignKey',
      'created_at'       => 'Date',
      'updated_at'       => 'Date',
    );
  }
}
